<?php

class monPDO extends PDO
{
   public function __construct()
   {
      parent::__construct('mysql:host=localhost;dbname=PariGest', 'parigest', 'parigest');
      $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      // Pour buffered les requetes
      $this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
      $this->query("SET NAMES 'utf8'");
   }

   public function prepare($sql, $options = array())
   {
      //echo "prepare";
      $statement = parent::prepare($sql, $options);
      $statement->setFetchMode(PDO::FETCH_ASSOC);
      return $statement;
   }
}

?>